@namespace Oqtane.Modules.Controls
@inherits ModuleControlBase
@implements ITextEditor

<div class="text-area-editor">
    <textarea @bind="_content" @ref="_editor" placeholder="@Placeholder" readonly="@ReadOnly" />
</div>

@code {
    public string Name => "Basic Text Editor";

    private ElementReference _editor;
    private string _content;

    [Parameter]
    public bool ReadOnly { get; set; }

    [Parameter]
    public string Placeholder { get; set; }

    public void Initialize(string content)
    {
        _content = content;

        StateHasChanged();
    }

    public async Task<string> GetContent()
    {
        await Task.CompletedTask;
        return _content;
    }
}
